package com.ontheroad.path.service;

import cn.modoumama.service.base.BaseService;
import com.ontheroad.api.request.PathRequest;
import com.ontheroad.api.response.Response;
import com.ontheroad.path.model.PathUserModel;
import com.ontheroad.path.model.Point;
import org.springframework.remoting.service.annotation.RemoteService;

import java.util.List;

/**
 * Created by kedong on 2017/6/29 0029.
 */
@RemoteService
public interface PathService extends BaseService<PathUserModel, Long> {

    /**
     * 上传运动轨迹
     *
     * @param request
     * @return
     */
    Response addPath(PathRequest request) throws Exception;

    /**
     * 保存轨迹点
     *
     * @param gpxStr
     * @param userId
     * @param pathUserId
     * @param pathSysId
     */
    void addPoint(String gpxStr, Integer userId, Integer pathUserId, Integer pathSysId);

    /**
     * 获取用户轨迹详情
     *
     * @param request
     * @return
     */
    Response getUserPathDetail(PathRequest request) throws Exception;

    /**
     * 获取用户轨迹列表
     *
     * @param request
     * @return
     * @throws Exception
     */
    Response getUserPathList(PathRequest request) throws Exception;

    /**
     * 获取系统轨迹列表
     *
     * @param request
     * @return
     */
    Response getSystemPathList(PathRequest request) throws Exception;

    /**
     * 获取系统轨迹详情
     *
     * @param request
     * @return
     * @throws Exception
     */
    Response getSystemPathDetail(PathRequest request) throws Exception;

    List<Point> findPointsByPathUserId(Long pathUserId);

    List<PathUserModel> findNearPath(Double lat, Double lng);
}
